<!--
 * @Author: your name
 * @Date: 2021-04-01 17:33:30
 * @LastEditTime: 2021-04-08 21:22:32
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \shop\training-group-5-warehouse\dianshang\src\components\Headerss.vue
-->
<!--  -->
<template>
  <header id="header">
    <span>
      <!--刘金海用着呢-->
      <van-icon name="arrow-left" @click="goCack" style="font-size: 20px;" />
    </span>
    <h1>{{ title }}</h1>

    <span>
      <van-icon name="ellipsis" style="font-size:20px;" />
    </span>
  </header>
</template>

<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  name: "Header",
  props: {
    title: {
      type: String,
      default: "导航栏",
    },
    show: {
      type: Number,
      default: 0,
    },
  },
  components: {},
  data() {
    //这里存放数据
    return {};
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    goCack() {
      console.log(this.$router.go(-1), "返回");
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
};
</script>
<style lang="scss" scoped>
#header {
  width: 100%;
  height: 45px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #555882;
}
#header h1 {
  font-size: 18px;
  text-align: center;
  line-height: 50px;
}
</style>
